/**
	* 数据字典 mixin
	*/
export default {

	install(Vue){
		Vue.mixin({
			data(){
				return {
					listTableTop: null
				}
			},
			created() {
				this.$nextTick(() => {
					if(this.$refs.listTable){
							this.listTableTop = this.$refs.listTable.$el.offsetTop;
					}

				});
			},
			watch:{
				showSearch(val){
					this.$nextTick(() => {
						if(this.$refs.listTable){
							this.listTableTop = this.$refs.listTable.$el.offsetTop;
						}
					});
				}
			},
			computed:{
				tableHeight(){
					if(this.listTableTop){
						let appHeight = this.$store.state.app.appSize.height || window.innerHeight;
						let height = appHeight - this.listTableTop - 160;
						return height;
					}
					return null;
				},
				dialogTableHeight(){
					if(this.listTableTop){
						let appHeight = this.$store.state.app.appSize.height || window.innerHeight;
						let height = appHeight - this.listTableTop - 300;
						return height;
					}
					return null;
				},
			}
		});
	}
}
